////////////////////////////////////////////////////////////////////////////////////////
// Stauffer Public Perceptions of Women's Inclusion and Feelings of Political Efficacy
// Replication Code - Appendix 11b
///////////////////////////////////////////////////////////////////////////////////////

***********
// TABLE A13
***********

*set working directory
use mturk_qual.dta, clear 

*Base Separate Models: Version 1
xtmixed efficacy1 r_estimate1 gender2 ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store samp1a

*Base Separate Models: Version 2
xtmixed efficacy2 r_estimate2 gender2 ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store samp2a

*Gender Interaction: Survey 1
xtmixed efficacy1 c.r_estimate1##i.gender2 ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store samp1b

*Gender Interaction: Survey 2
xtmixed efficacy2 c.r_estimate2##i.gender2 ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store samp2b

*Base + Survey Interaction
xtmixed efficacy_full c.r_estimate##i.survey gender2 ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store inta

*Gender + Survey Interaction 
xtmixed efficacy_full c.r_estimate##i.gender2##i.survey ideo72 republican2 independent2 strong_partisan2 ///
religiosity2 white employ2 c.age2##c.age2 coll know_fed woman_sen || state:, cov(uns)

estimates store intb

*Generate LaTex Code for table 
estout samp1a samp1b samp2a samp2b inta intb, cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)
